*{
    margin: 0;
    padding: 0;
    text-align: center;
} 
li{
    list-style: none;
}
#ul1{
    height: auto;
    overflow: hidden;
    margin: 20px auto;
    border: 1px solid #000;
    border-bottom: none;
    border-right: none;
}
#ul1 li{
    border: 1px solid #000;
    border-left: none;
    border-top: none;
    float: left;
}
#ul1 li.sty1{
    background: red;
}
#ul1 li.sty2{
    background: green;
}
#ul1 li.sty3{
    background: blue;
}